<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let uname = [20, 45, 78, 20]
      function handleData(arr, zhen = true) {
        let num = 0
        for (let i = 0; i < arr.lrngth; i++) {
          if (typeof zhen === 'true') {
            num += arr[i]
          } else {
            ;(num += arr[i]) / arr.length
          }
        }
        if (zhen) {
          return num
        } else {
          return [(num += arr[i]) / arr.length]
        }
      }
      let b = handleData(uname, true)
      console.log(b)
    </script>
  </body>
</html>
